<template>
  <el-row style="height: 100%;display: flex;flex-direction: column;">
    <scroll-view style="height: 90vh" scroll-y="true">
      <el-row style="display: flex;width: 100%">
        <el-row style="background-color: #fff;width: 100%;">
          <el-row>
            <el-row style="display: flex;flex-direction: row;align-items: center;margin: 10rpx;">
              <el-row style="align-items: center;">
                <el-text>职业：</el-text>
                <el-select style="width: 120rpx;" v-model="currentClassName" placeholder="职业"
                           @change="selectProfessionChange">
                  <el-option style="font-size: 20rpx;" v-for="item in className" :label="item.value"
                             :value="item.value"/>
                </el-select>
              </el-row>
              <el-row style="align-items: center;margin-left: 20rpx">
                <el-text>境界：</el-text>
                <el-select v-model="currentRealm" style="width: 150rpx" placeholder="境界"
                           @change="selectRealmChange" value-key="cultivationLevel">
                  <el-option v-for="item in realmList" :label="item.cultivationLevel" :value="item"/>
                </el-select>
              </el-row>
              <el-row style="flex: 1;align-items: center;justify-content: right;margin-left: 20rpx">
                <el-text>筛选：</el-text>
                <el-input v-model="equipmentLevel" placeholder="输入装备等级搜索" clearable style="width:200rpx"
                          @input="equipmentLevelChange"/>
              </el-row>
            </el-row>
          </el-row>
          <el-row align="top" style="height: 30rpx;width: 100%;;margin-bottom: 10rpx;margin-left: 10rpx;">
            <el-row justify="center" style="text-align: center;flex: 1;">
              <el-text>装备</el-text>
            </el-row>
            <!-- <el-row justify="center" style="text-align: center;width: 300rpx">
              <el-text>灌注&升级</el-text></el-row> -->
            <el-row justify="center" style="text-align: center;width: 200rpx;">
              <el-text>套装/强化</el-text>
            </el-row>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;width: 100%;">
            <el-text>武器</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[0]" style="width: 100%;"
                         :model-value="currentEquipment[0]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Weapon" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[0]?.coreAttribute>0">核心：{{ currentEquipment[0]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.constitution>0">体：{{ currentEquipment[0]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.physicalDefense">物理防御：{{ currentEquipment[0]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.criticalStrike>0">会心：{{ currentEquipment[0]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.recovery>0">调息：{{ currentEquipment[0]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.expertise>0">专精：{{ currentEquipment[0]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.armorPenetration>0">破甲：{{ currentEquipment[0]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[0]?.accuracy>0">命中：{{ currentEquipment[0]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[0]?.equipmentSource }}</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;height: 45rpx;margin:0 20rpx;align-content: center;">
              <el-text>无</el-text>
            </el-row>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>上身</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[1]" style="width: 100%;"
                         :model-value="currentEquipment[1]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.UpperBody" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[1]?.coreAttribute>0">核心：{{ currentEquipment[1]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.constitution>0">体：{{ currentEquipment[1]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.physicalDefense">物理防御：{{ currentEquipment[1]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.criticalStrike>0">会心：{{ currentEquipment[1]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.recovery>0">调息：{{ currentEquipment[1]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.expertise>0">专精：{{ currentEquipment[1]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.armorPenetration>0">破甲：{{ currentEquipment[1]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[1]?.accuracy>0">命中：{{ currentEquipment[1]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[1]?.equipmentSource }}</el-text>
            </el-row>
            <el-select style="text-align: center;width: 180rpx;margin:0 20rpx;" v-model="currentSuitLevel[1]"
                       value-key="name" :disabled="currentEquipment[1]?.equipmentSource?.indexOf('套装')!==-1"
                       placeholder="套装" @change="isSuitChange($event,1)">
              <el-option v-for="item in suitLevel" :key="item.level" :label="item.name" :value="item"/>
            </el-select>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>头部</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[2]" style="width: 100%;"
                         :model-value="currentEquipment[2]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Head" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[2]?.coreAttribute>0">核心：{{ currentEquipment[2]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.constitution>0">体：{{ currentEquipment[2]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.physicalDefense">物理防御：{{ currentEquipment[2]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.criticalStrike>0">会心：{{ currentEquipment[2]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.recovery>0">调息：{{ currentEquipment[2]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.expertise>0">专精：{{ currentEquipment[2]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.armorPenetration>0">破甲：{{ currentEquipment[2]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[2]?.accuracy>0">命中：{{ currentEquipment[2]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[2]?.equipmentSource }}</el-text>
            </el-row>
            <el-select style="text-align: center;width: 180rpx;margin:0 20rpx;" v-model="currentSuitLevel[2]"
                       value-key="name" :disabled="currentEquipment[2]?.equipmentSource?.indexOf('套装')!==-1"
                       placeholder="套装" @change="isSuitChange($event,2)">
              <el-option v-for="item in suitLevel" :key="item.level" :label="item.name" :value="item"/>
            </el-select>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>手部</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[3]" style="width: 100%;"
                         :model-value="currentEquipment[3]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Hand" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[3]?.coreAttribute>0">核心：{{ currentEquipment[3]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.constitution>0">体：{{ currentEquipment[3]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.physicalDefense">物理防御：{{ currentEquipment[3]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.criticalStrike>0">会心：{{ currentEquipment[3]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.recovery>0">调息：{{ currentEquipment[3]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.expertise>0">专精：{{ currentEquipment[3]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.armorPenetration>0">破甲：{{ currentEquipment[3]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[3]?.accuracy>0">命中：{{ currentEquipment[3]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[3]?.equipmentSource }}</el-text>
            </el-row>
            <el-select style="width: 180rpx;margin:0 20rpx;" v-model="currentSuitLevel[3]" value-key="name"
                       :disabled="currentEquipment[3]?.equipmentSource?.indexOf('套装')!==-1" placeholder="套装"
                       @change="isSuitChange($event,3)">
              <el-option v-for="item in suitLevel" :key="item.level" :label="item.name" :value="item"/>
            </el-select>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>腰部</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[4]" style="width: 100%;"
                         :model-value="currentEquipment[4]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Waist" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[4]?.coreAttribute>0">核心：{{ currentEquipment[4]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.constitution>0">体：{{ currentEquipment[4]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.physicalDefense">物理防御：{{ currentEquipment[4]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.criticalStrike>0">会心：{{ currentEquipment[4]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.recovery>0">调息：{{ currentEquipment[4]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.expertise>0">专精：{{ currentEquipment[4]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.armorPenetration>0">破甲：{{ currentEquipment[4]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[4]?.accuracy>0">命中：{{ currentEquipment[4]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[4]?.equipmentSource }}</el-text>
            </el-row>
            <el-select style="width: 180rpx;margin:0 20rpx;" v-model="currentSuitLevel[4]" value-key="name"
                       :disabled="currentEquipment[4]?.equipmentSource?.indexOf('套装')!==-1" placeholder="套装"
                       @change="isSuitChange($event,4)">
              <el-option v-for="item in suitLevel" :key="item.level" :label="item.name" :value="item"/>
            </el-select>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>脚部</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[5]" style="width: 100%;"
                         :model-value="currentEquipment[5]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Foot" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[5]?.coreAttribute>0">核心：{{ currentEquipment[5]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.constitution>0">体：{{ currentEquipment[5]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.physicalDefense">物理防御：{{ currentEquipment[5]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.criticalStrike>0">会心：{{ currentEquipment[5]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.recovery>0">调息：{{ currentEquipment[5]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.expertise>0">专精：{{ currentEquipment[5]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.armorPenetration>0">破甲：{{ currentEquipment[5]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[5]?.accuracy>0">命中：{{ currentEquipment[5]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[5]?.equipmentSource }}</el-text>
            </el-row>
            <el-select style="width: 180rpx;margin:0 20rpx;" v-model="currentSuitLevel[5]" value-key="name"
                       :disabled="currentEquipment[5]?.equipmentSource?.indexOf('套装')!==-1" placeholder="套装"
                       @change="isSuitChange($event,5)">
              <el-option v-for="item in suitLevel" :key="item.level" :label="item.name" :value="item"/>
            </el-select>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>护符</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[6]" style="width: 100%;"
                         :model-value="currentEquipment[6]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Charm1" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[6]?.coreAttribute>0">核心：{{ currentEquipment[6]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.constitution>0">体：{{ currentEquipment[6]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.physicalDefense">物理防御：{{ currentEquipment[6]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.criticalStrike>0">会心：{{ currentEquipment[6]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.recovery>0">调息：{{ currentEquipment[6]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.expertise>0">专精：{{ currentEquipment[6]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.armorPenetration>0">破甲：{{ currentEquipment[6]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[6]?.accuracy>0">命中：{{ currentEquipment[6]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[6]?.equipmentSource }}</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;height: 45rpx;margin:0 20rpx;align-content: center;"
                    v-show="!currentEquipment[6]?.isLoongSpiritEnhanced">
              <el-text>无</el-text>
            </el-row>
            <el-row justify="center" style="text-align: center;width: 180rpx;margin:0 20rpx"
                    v-show="currentEquipment[6]?.isLoongSpiritEnhanced">
              <el-select v-model="loongSpiritEnhanced[6]" class="m-2" placeholder="龙魂符强化"
                         @visible-change="loongSpiritEnhancedList($event,6)"
                         @change="loongSpiritEnhancedSelectChange(6)">
                <el-option v-for="item in loongSpiritEnhancedLevel" :key="item" :label="item" :value="item"/>
              </el-select>
            </el-row>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>护符</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[7]" style="width: 100%;"
                         :model-value="currentEquipment[7]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange1">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Charm2" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[7]?.coreAttribute>0">核心：{{ currentEquipment[7]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.constitution>0">体：{{ currentEquipment[7]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.physicalDefense">物理防御：{{ currentEquipment[7]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.criticalStrike>0">会心：{{ currentEquipment[7]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.recovery>0">调息：{{ currentEquipment[7]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.expertise>0">专精：{{ currentEquipment[7]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.armorPenetration>0">破甲：{{ currentEquipment[7]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[7]?.accuracy>0">命中：{{ currentEquipment[7]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[7]?.equipmentSource }}</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;height: 45rpx;margin:0 20rpx;align-content: center;"
                    v-show="!currentEquipment[7]?.isLoongSpiritEnhanced">
              <el-text>无</el-text>
            </el-row>
            <el-row justify="center" style="text-align: center;width: 180rpx;margin:0 20rpx"
                    v-show="currentEquipment[7]?.isLoongSpiritEnhanced">
              <el-select v-model="loongSpiritEnhanced[7]" placeholder="龙魂符强化"
                         @visible-change="loongSpiritEnhancedList($event,7)"
                         @change="loongSpiritEnhancedSelectChange(7)">
                <el-option v-for="item in loongSpiritEnhancedLevel" :key="item" :label="item" :value="item"/>
              </el-select>
            </el-row>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>法印</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[8]" style="width: 100%;"
                         :model-value="currentEquipment[8]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Seal" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[8]?.coreAttribute>0">核心：{{ currentEquipment[8]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.constitution>0">体：{{ currentEquipment[8]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.physicalDefense">物理防御：{{ currentEquipment[8]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.criticalStrike>0">会心：{{ currentEquipment[8]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.recovery>0">调息：{{ currentEquipment[8]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.expertise>0">专精：{{ currentEquipment[8]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.armorPenetration>0">破甲：{{ currentEquipment[8]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[8]?.accuracy>0">命中：{{ currentEquipment[8]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[8]?.equipmentSource }}</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;height: 45rpx;margin:0 20rpx;align-content: center;"
                    v-show="!currentEquipment[8]?.isLoongSpiritEnhanced">
              <el-text>无</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;margin:0 20rpx"
                    v-show="currentEquipment[8]?.isLoongSpiritEnhanced">
              <el-select v-model="loongSpiritEnhanced[8]" class="m-2" placeholder="龙魂符强化"
                         @visible-change="loongSpiritEnhancedList($event,8)"
                         @change="loongSpiritEnhancedSelectChange(8)">
                <el-option v-for="item in loongSpiritEnhancedLevel" :key="item" :label="item" :value="item"/>
              </el-select>
            </el-row>
          </el-row>
          <el-row justify="start" style="margin-left: 10rpx;margin-top: 20rpx;width: 100%;">
            <el-text>令牌</el-text>
            <el-row style="display: grid;margin-left: 10rpx;flex: 1;">
              <el-select v-model="currentEquipment[9]" style="width: 100%;"
                         :model-value="currentEquipment[9]?.equipmentName" value-key="id" placeholder="请选择装备"
                         @change="equipmentSelectChange">
                <el-option style="font-size: 22rpx;" v-for="item in classEquipment?.Token" :key="item.id"
                           :label="item.equipmentName" :value="item"/>
              </el-select>
              <el-row style="margin-top: 5rpx;max-width: 450rpx;">
                <el-text
                    v-show="currentEquipment[9]?.coreAttribute>0">核心：{{ currentEquipment[9]?.coreAttribute }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.constitution>0">体：{{ currentEquipment[9]?.constitution }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.physicalDefense">物理防御：{{ currentEquipment[9]?.physicalDefense }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.criticalStrike>0">会心：{{ currentEquipment[9]?.criticalStrike }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.recovery>0">调息：{{ currentEquipment[9]?.recovery }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.expertise>0">专精：{{ currentEquipment[9]?.expertise }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.armorPenetration>0">破甲：{{ currentEquipment[9]?.armorPenetration }}
                </el-text>
                <el-text style="margin-left: 10rpx;"
                         v-show="currentEquipment[9]?.accuracy>0">命中：{{ currentEquipment[9]?.accuracy }}
                </el-text>
              </el-row>
              <el-text>来源：{{ currentEquipment[9]?.equipmentSource }}</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;height: 45rpx;margin:0 20rpx;align-content: center;"
                    v-show="!currentEquipment[9]?.isLoongSpiritEnhanced">
              <el-text>无</el-text>
            </el-row>
            <el-row justify="center" style="width: 180rpx;margin:0 20rpx"
                    v-show="currentEquipment[9]?.isLoongSpiritEnhanced">
              <el-select v-model="loongSpiritEnhanced[9]" class="m-2" placeholder="龙魂符强化"
                         @visible-change="loongSpiritEnhancedList($event,9)"
                         @change="loongSpiritEnhancedSelectChange(9)">
                <el-option v-for="item in loongSpiritEnhancedLevel" :key="item" :label="item" :value="item"/>
              </el-select>
            </el-row>
          </el-row>
          <el-row style="width: 100%;border: #666 dashed 2rpx;margin-top: 20rpx;padding: 10rpx;display: flex">
            <el-text style="width: 30rpx">灌注</el-text>
            <el-row style="flex: 1">
              <el-row justify="start" style="width: 100%;display: flex;flex-flow: row;">
                <el-text>上身</el-text>
                <el-select style="margin-left: 10rpx;flex: 1;" v-model="currentUpperBodyInlay['1']"
                           placeholder="灌注1" value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in upperBodyInlay" :key="item.id" :label="item.description"
                             :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;flex: 1;" v-model="currentUpperBodyInlay['2']"
                           placeholder="灌注2" value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in upperBodyInlay" :key="item.id" :label="item.description"
                             :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;margin-right:10rpx;flex: 1;"
                           v-model="currentUpperBodyInlay['3']" placeholder="灌注3" value-key="description"
                           @change="inlaySelectChange">
                  <el-option v-for="item in upperBodyInlay" :key="item.id" :label="item.description"
                             :value="item"/>
                </el-select>
              </el-row>
              <el-row justify="start" style="width: 100%;display: flex;flex-flow: row;margin-top: 20rpx;">
                <el-text>头部</el-text>
                <el-select style="margin-left: 10rpx;flex: 1;" v-model="currentHeadInlay['1']" placeholder="灌注1"
                           value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in headInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;flex: 1;" v-model="currentHeadInlay['2']" placeholder="灌注2"
                           value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in headInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;margin-right:10rpx;flex: 1;" v-model="currentHeadInlay['3']"
                           placeholder="灌注3" value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in headInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
              </el-row>
              <el-row justify="start" style="width: 100%;display: flex;flex-flow: row;margin-top: 20rpx;">
                <el-text>手部</el-text>
                <el-select style="margin-left: 10rpx;flex: 1;" v-model="currentHandInlay['1']" placeholder="灌注1"
                           value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in handInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;flex: 1;" v-model="currentHandInlay['2']" placeholder="灌注2"
                           value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in handInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;margin-right:10rpx;flex: 1;" v-model="currentHandInlay['3']"
                           placeholder="灌注3" value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in handInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
              </el-row>
              <el-row justify="start" style="width: 100%;display: flex;flex-flow: row;margin-top: 20rpx;">
                <el-text>腰部</el-text>
                <el-select style="margin-left: 10rpx;flex: 1;" v-model="currentWaistInlay['1']" placeholder="灌注1"
                           value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in waistInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;flex: 1;" v-model="currentWaistInlay['2']" placeholder="灌注2"
                           value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in waistInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
                <el-select style="margin-left: 20rpx;margin-right:10rpx;flex: 1;" v-model="currentWaistInlay['3']"
                           placeholder="灌注3" value-key="description" @change="inlaySelectChange">
                  <el-option v-for="item in waistInlay" :key="item.id" :label="item.description" :value="item"/>
                </el-select>
              </el-row>
            </el-row>
          </el-row>

          <el-row justify="center" style="width: 100%;padding: 10rpx;border: #666 dashed 2rpx">
            <el-text style="width: 30rpx">属性结果</el-text>
            <el-row style="display: grid;">
              <el-text>体 : {{ result.constitution.toFixed(0) }}</el-text>
              <el-text>气血 : {{ result.HP.toFixed(0) }}</el-text>
              <el-text>核心属性 : {{ result.coreAttribute.toFixed(0) }}</el-text>
              <el-text>物理攻击 : {{ (result.coreAttribute / 5).toFixed(0) }}</el-text>
              <el-text>魔法攻击 : {{ (result.coreAttribute / 5).toFixed(0) }}</el-text>
            </el-row>
            <el-row style="display: grid;flex: 1;margin-left: 30rpx">
              <el-row>
                <el-text style="width: 130rpx">会心 : {{ result.criticalStrike }}</el-text>
                <el-text>（{{ (result.criticalStrike / 39 + currentSkillTreeCriticalStrike).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="width: 130rpx">调息 : {{ result.recovery }}</el-text>
                <el-text>（{{ (result.recovery / 39 + currentSkillTreeCD).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="width: 130rpx">专精 : {{ result.expertise }}</el-text>
                <el-text>（{{ (result.expertise / 39 + currentSkillTreePureEssence).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="width: 130rpx">破甲 : {{ result.armorPenetration }}</el-text>
                <el-text>（{{ (result.armorPenetration / 39).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="width: 130rpx">命中 : {{ result.accuracy }}</el-text>
                <el-text>（{{ (result.accuracy / 39 + 100).toFixed(2) }}%）</el-text>
              </el-row>
            </el-row>
            <el-row style="display: grid;margin-right: 30rpx">
              <el-text>物理防御 : {{ result.physicalDefense.toFixed(0) }}</el-text>
              <el-text>魔法防御 : {{ result.magicDefense.toFixed(0) }}</el-text>
            </el-row>
          </el-row>

          <el-row justify="center" style="width: 100%;border: #666 dashed 2rpx;display: flex;text-align: center;padding: 5rpx">
            <el-text style="width: 30rpx;">天书</el-text>
            <el-row style="margin: 10rpx;flex: 1">
              <el-row style="display: flex;flex-flow: row; align-items: center;" v-show="isShowCriticalStrike">
                <el-text>会心%</el-text>
                <el-select v-model="currentSkillTreeCriticalStrike" style="width: 100rpx;margin-left: 10rpx;"
                           placeholder="空" value-key="name" @change="inlaySelectChange">
                  <el-option v-for="item in skillTreeCriticalStrike" :key="item" :label="item" :value="item"/>
                </el-select>
              </el-row>
              <el-row style="display: flex;flex-flow: row; align-items: center;margin-left: 20rpx;"
                      v-show="isShowCD">
                <el-text>调息%</el-text>
                <el-select v-model="currentSkillTreeCD" style="width: 100rpx;margin-left: 10rpx;"
                           placeholder="空" value-key="name" @change="inlaySelectChange">
                  <el-option v-for="item in skillTreeCD" :key="item" :label="item" :value="item"/>
                </el-select>
              </el-row>
              <el-row style="display: flex;flex-flow: row; align-items: center;margin-left: 20rpx;"
                      v-show="isShowPureEssence">
                <el-text>专精%</el-text>
                <el-select v-model="currentSkillTreePureEssence" style="width: 100rpx;margin-left: 10rpx;"
                           placeholder="空" value-key="name" @change="inlaySelectChange">
                  <el-option v-for="item in skillTreePureEssence" :key="item" :label="item" :value="item"/>
                </el-select>
              </el-row>
              <el-row style="display: flex;flex-flow: row; align-items: center;margin-left: 20rpx;"
                      v-show="isShowDefense">
                <el-text>防御%</el-text>
                <el-select v-model="currentSkillTreeDefense" style="width: 100rpx;margin-left: 10rpx;"
                           placeholder="空" value-key="name" @change="inlaySelectChange">
                  <el-option v-for="item in skillTreeDefense" :key="item" :label="item" :value="item"/>
                </el-select>
              </el-row>
              <el-row style="display: flex;flex-flow: row; align-items: center;margin-left: 20rpx;"
                      v-show="isShowHP">
                <el-text>气血%</el-text>
                <el-select v-model="currentSkillTreeHP" style="width: 100rpx;margin-left: 10rpx;"
                           placeholder="空" value-key="name" @change="inlaySelectChange">
                  <el-option v-for="item in skillTreeHP" :key="item" :label="item" :value="item"/>
                </el-select>
              </el-row>
            </el-row>
          </el-row>

          <el-row justify="start" style="display: flex;border: #666 dashed 2rpx;width: 100%;padding: 10rpx">
            <el-text style="width: 30rpx">法宝</el-text>
            <el-select v-model="currentAMagicWeapon" style="flex: 0.5;align-content: center" placeholder="无" value-key="id"
                       @change="aMagicWeaponSelectChange">
              <el-option v-for="item in aMagicWeaponList" :key="item.id" :label="item.name"
                         :value="item">
                <span style="float: left">{{ item.name }}</span>
                <span v-show="item.criticalStrike>0">[{{ item.criticalStrike }}会心]</span>
                <span v-show="item.recovery>0">[{{ item.recovery }}调息]</span>
                <span v-show="item.expertise>0">[{{ item.expertise }}专精]</span>
                <span v-show="item.armorPenetration>0">[{{ item.armorPenetration }}破甲]</span>
                <span v-show="item.accuracy>0">[{{ item.accuracy }}命中]</span>
              </el-option>
            </el-select>
          </el-row>

          <el-row style="width: 100%;padding: 10rpx;display: flex;align-items: center;border: #666 dashed 2rpx;">
            <el-text style="width: 30rpx">星魄</el-text>
            <el-row style="flex: 1">
              <el-text>青龙</el-text>
              <el-select v-model="currentXingPo[0]" style="flex: 1" placeholder="空" value-key="level"
                         @change="xingPoSelectChange">
                <el-option v-for="item in xingPoLevel" :key="item" :label="item.level"
                           :value="item"/>
              </el-select>
            </el-row>
            <el-row style="flex: 1">
              <el-text style="margin-left: 10rpx">白虎</el-text>
              <el-select v-model="currentXingPo[1]" style="flex: 1" placeholder="空" value-key="level"
                         @change="xingPoSelectChange">
                <el-option v-for="item in xingPoLevel" :key="item" :label="item.level"
                           :value="item"/>
              </el-select>
            </el-row>
            <el-row style="flex: 1">
              <el-text style="margin-left: 10rpx">玄武</el-text>
              <el-select v-model="currentXingPo[2]" style="flex: 1" placeholder="空" value-key="level"
                         @change="xingPoSelectChange">
                <el-option v-for="item in xingPoLevel" :key="item" :label="item.level"
                           :value="item"/>
              </el-select>
            </el-row>
            <el-row style="flex: 1">
              <el-text style="margin-left: 10rpx">朱雀</el-text>
              <el-select v-model="currentXingPo[3]" style="flex: 1" placeholder="空" value-key="level"
                         @change="xingPoSelectChange">
                <el-option v-for="item in xingPoLevel" :key="item" :label="item.level"
                           :value="item"/>
              </el-select>
            </el-row>
          </el-row>

          <el-row style="width:100%;border: #666 dashed 2rpx;padding: 10rpx">
            <el-text style="width: 30rpx">套装效果</el-text>
            <el-row style="flex: 1">
              <el-row style="display: grid" v-show="suitOther>=1">
                <el-text>其他套装</el-text>
                <el-text :style="{color: suitOther >= 2 ? 'chocolate' : '#aaaaaa'}">
                  2：会心、专精、调息和破甲属性中最高和最低值每相差100点，造成的伤害和治疗增加0.1%
                </el-text>
              </el-row>
              <el-row style="display: grid" v-show="suitNumber315>=2">
                <el-row>305套装</el-row>
                <el-row :style="{color: suitNumber315 >= 2 ? 'chocolate' : '#aaaaaa'}">
                  2：核心属性增加180点
                </el-row>
                <el-row :style="{color: suitNumber315 >= 4 ? 'chocolate' : '#aaaaaa'}">
                  4：最高的额外属性（会心、专精、调息、破甲）增加195点
                </el-row>
              </el-row>
              <el-row style="display: grid;margin-top: 10rpx" v-show="suitSize1 >= 2 || suitSize2 >= 2">
                <el-row>
                  <el-text style="margin-right: 20rpx">325套装</el-text>
                  <el-text style="border: 1rpx dashed #666;border-radius: 3rpx;padding: 5rpx" v-show="suitSize1>=2">
                    {{ classSchool[0] }}
                  </el-text>
                  <el-text style="border: 1rpx dashed #666;border-radius: 3rpx;padding: 5rpx" v-show="suitSize2>=2">
                    {{ classSchool[1] }}
                  </el-text>
                </el-row>
                <el-row style="display: flex;flex-flow: row" v-show="suitSize1>=2">
                  <el-row style="flex:1;display: flex;flex-flow: column;margin-left: 5rpx">
                    <el-text v-show="suitSize1>=2" :style="{color: suitSize1 >= 2 ? 'chocolate' : '#aaaaaa'}">
                      {{ suitAttribute1[0] }}
                    </el-text>
                    <el-text v-show="suitSize1>=2" :style="{color: suitSize1 >= 4 ? 'chocolate' : '#aaaaaa'}">
                      {{ suitAttribute1[1] }}
                    </el-text>
                  </el-row>
                </el-row>
                <el-row style="display: flex;flex-flow: row;margin-top: 5rpx" v-show="suitSize2>=2">
                  <el-row style="flex:1;display: flex;flex-flow: column;margin-left: 5rpx">
                    <el-text v-show="suitSize2>=2" :style="{color: suitSize2 >= 2 ? 'chocolate' : '#aaaaaa'}">
                      {{ suitAttribute2[0] }}
                    </el-text>
                    <el-text v-show="suitSize2>=2" :style="{color: suitSize2 >= 4 ? 'chocolate' : '#aaaaaa'}">
                      {{ suitAttribute2[1] }}
                    </el-text>
                  </el-row>
                </el-row>
              </el-row>
              <el-text v-show="suitSize1 < 2 && suitSize2 < 2 && suitNumber315 <2" style="color: #999">无</el-text>
            </el-row>
          </el-row>

          <el-row style="width: 100%;border: #666 dashed 2rpx;padding: 10rpx">
            <el-text style="width: 30rpx">特殊效果</el-text>
            <el-row style="flex: 1">
              <el-text v-for="item in specialAttributeList" :key="item.content" style="color: chocolate">
                {{ item.type + "：" + item.content }}
              </el-text>
              <el-text v-show="specialAttributeList?.length===0" style="color: #999">无</el-text>
            </el-row>
          </el-row>
        </el-row>
      </el-row>
    </scroll-view>
    <el-row style="width: 100%;height: 120rpx;padding: 20rpx;background: white;">
      <el-button type="success" style="flex: 1" @click="save">保存当前配装</el-button>
      <el-button type="primary" style="flex: 1" @click="saveImage">分享好友</el-button>
    </el-row>
  </el-row>
  <el-dialog v-model="submitEquipmentDialog" title="是否要保存当前配装内容？" align-center :show-close="false"
             :before-close="()=>{}">
    <el-form :model="submitEquipmentFrom" label-position="right" label-width="100rpx">
      <el-form-item label="职业：">{{ currentClassName }}</el-form-item>
      <el-form-item label="职业专精：">{{ currentClassSchool }}</el-form-item>
      <el-form-item label="配装名称：">
        <el-input v-model="submitEquipmentFrom.name" autocomplete="off" style="width: 250rpx"/>
      </el-form-item>
      <!--      <el-row>-->
      <!--        <el-checkbox v-model="isShareHot" label="是否分享配装至职业热门推荐" size="large" style="margin-left: 20rpx"/>-->
      <!--      </el-row>-->
    </el-form>
    <template #footer>
			<span class="dialog-footer">
				<el-button @click="submitEquipmentCancel">取消</el-button>
				<el-button type="primary" @click="submitEquipmentBtn">
					保存
				</el-button>
			</span>
    </template>
  </el-dialog>

  <el-dialog style="width: 100%;padding: 0" align-center v-model="isShowSaveImageDialog">
    <template #header>
      <el-button type="primary" style="margin-left: 30rpx" @click="saveImage1">生成以下内容为图片</el-button>
    </template>
    <el-row :style="{backgroundImage:imagePath}" style="width: 100%;border-radius:10rpx;justify-content: center">
      <el-watermark content="www.zxsjtools.cn" style="width: 100%" id="imageSave">
        <el-row style="width:100%;display: flex;flex-flow: column;padding: 10rpx;opacity: 0.9;background: #f8f8f8;border-radius: 10rpx">
          <el-row style="align-items: center;" justify="center">
            <el-text>
              职业：{{ currentClassName }}-{{ currentClassSchool }}
            </el-text>
            <el-text style="margin-left: 10rpx">
              境界：{{ currentRealm.cultivationLevel }}
            </el-text>
            <el-text style="margin-left: 10rpx">
              法宝：{{ currentAMagicWeapon?.name || '无' }}
            </el-text>
            <el-text style="margin-left: 10rpx">
              天书：
              <el-text
                  v-show="currentSkillTreeCriticalStrike>0">[会心：{{ currentSkillTreeCriticalStrike }}%]
              </el-text>
              <el-text v-show="currentSkillTreeCD>0">[调息：{{ currentSkillTreeCD }}%]</el-text>
              <el-text
                  v-show="currentSkillTreePureEssence>0">[专精：{{ currentSkillTreePureEssence }}%]
              </el-text>
              <el-text v-show="currentSkillTreeDefense>0">[防御：{{ currentSkillTreeDefense }}%]</el-text>
              <el-text v-show="currentSkillTreeHP>0">[气血：{{ currentSkillTreeHP }}%]</el-text>
              <el-text
                  v-show="currentSkillTreeCriticalStrike===0&&currentSkillTreeCD===0&&currentSkillTreePureEssence===0&&currentSkillTreeDefense===0&&currentSkillTreeHP===0">无
              </el-text>
            </el-text>
          </el-row>
          <el-row style="border: 2rpx solid #999999;border-radius: 5rpx ;width: 100%;padding: 10rpx;margin-top: 5rpx">
            <el-row style="width: 100%;margin-bottom: 10rpx;display: flex;flex-flow: row" v-for="item in currentEquipment" :key="item.id">
              <el-text style="line-height:30rpx;color:#333333;width: 37%">
                {{ item.equipmentSlot + "：" + item.equipmentName.split('（')[0] }}
              </el-text>
              <el-row style="width: 38%">
                <el-text style="line-height:30rpx;color:#333333;margin-left: 10rpx" v-show="item.criticalStrike>0">
                  会心：{{ item.criticalStrike }}
                </el-text>
                <el-text style="line-height:30rpx;color:#333333;margin-left: 10rpx" v-show="item.recovery>0">
                  调息：{{ item.recovery }}
                </el-text>
                <el-text style="line-height:30rpx;color:#333333;margin-left: 10rpx" v-show="item.expertise>0">
                  专精：{{ item.expertise }}
                </el-text>
                <el-text style="line-height:30rpx;color:#333333;margin-left: 10rpx" v-show="item.armorPenetration>0">
                  破甲：{{ item.armorPenetration }}
                </el-text>
                <el-text style="line-height:30rpx;color:#333333;margin-left: 10rpx" v-show="item.accuracy>0">
                  命中：{{ item.accuracy }}
                </el-text>
              </el-row>
              <el-text style="line-height: 30rpx;color:#333333;margin-left: 20rpx;width: 25%">
                来源：{{ item.equipmentSource }}
              </el-text>
            </el-row>
          </el-row>
          <el-row style="margin-top: 5rpx;padding: 10rpx;border: 2rpx solid #999999;border-radius: 5rpx;">
            <el-row style="display: grid;">
              <el-text>灌注方案</el-text>
              <el-text>头部：
                <el-text v-for="item in currentHeadInlay" :key="item.id">
                  {{ item.description }}|
                </el-text>
              </el-text>
              <el-text>上身：
                <el-text v-for="item in currentUpperBodyInlay" :key="item.id">
                  {{ item.description }}|
                </el-text>
              </el-text>
              <el-text>手部：
                <el-text v-for="item in currentHandInlay" :key="item.id">
                  {{ item.description }}|
                </el-text>
              </el-text>
              <el-text>腰部：
                <el-text v-for="item in currentWaistInlay" :key="item.id">
                  {{ item.description }}|
                </el-text>
              </el-text>
            </el-row>
            <el-row style="display: grid;margin-left: 30rpx">
              <el-text>龙魂符强化</el-text>
              <el-text>护符：{{ loongSpiritEnhanced[6] }}级</el-text>
              <el-text>护符：{{ loongSpiritEnhanced[7] }}级</el-text>
              <el-text>法印：{{ loongSpiritEnhanced[8] }}级</el-text>
              <el-text>令牌：{{ loongSpiritEnhanced[9] }}级</el-text>
            </el-row>
          </el-row>
          <el-row style="border: 2rpx solid #999999;border-radius: 5rpx;margin-top: 5rpx;padding: 10rpx">
            <el-text>套装融合</el-text>
            <el-text v-show="currentEquipment[1]?.equipmentSource?.indexOf('套装')===-1">
              【上身】{{ currentSuitLevel[1]?.name || "无" }}
            </el-text>
            <el-text v-show="currentEquipment[2]?.equipmentSource?.indexOf('套装')===-1">
              【头部】{{ currentSuitLevel[2]?.name || "无" }}
            </el-text>
            <el-text v-show="currentEquipment[3]?.equipmentSource?.indexOf('套装')===-1">
              【手部】{{ currentSuitLevel[3]?.name || "无" }}
            </el-text>
            <el-text v-show="currentEquipment[4]?.equipmentSource?.indexOf('套装')===-1">
              【腰部】{{ currentSuitLevel[4]?.name || "无" }}
            </el-text>
            <el-text v-show="currentEquipment[5]?.equipmentSource?.indexOf('套装')===-1">
              【脚部】{{ currentSuitLevel[5]?.name || "无" }}
            </el-text>
          </el-row>
          <el-row style="display: flex;flex-flow: row;align-items: center;border: 2rpx solid #999999;border-radius: 5rpx;margin-top: 5rpx;padding: 10rpx"
                  justify="center">
            <el-text style="margin-right: 10rpx;width: 30rpx">星魄</el-text>
            <el-row>
              <el-row>
                <el-text>[青龙：{{ currentXingPo[0].level }}级{{ currentXingPo[0].coreAttribute }}核心{{ currentXingPo[0].attribute * 3 }}会心]</el-text>
                <el-text>[白虎：{{ currentXingPo[0].level }}级{{ currentXingPo[0].coreAttribute }}核心{{ currentXingPo[0].attribute * 3 }}调息]</el-text>
              </el-row>
              <el-row>
                <el-text>[玄武：{{ currentXingPo[0].level }}级{{ currentXingPo[0].coreAttribute }}核心{{ currentXingPo[0].attribute * 3 }}破甲]</el-text>
                <el-text>[朱雀：{{ currentXingPo[0].level }}级{{ currentXingPo[0].coreAttribute }}核心{{ currentXingPo[0].attribute * 3 }}专精]</el-text>
              </el-row>
            </el-row>
          </el-row>
          <el-row style="margin-top: 5rpx;padding: 10rpx;border: 2rpx solid #999999;border-radius: 5rpx ;">
            <el-row style="display: grid;">
              <el-text style="color: #333333">体 : {{ result.constitution.toFixed(0) }}</el-text>
              <el-text style="color: #333333">气血 : {{ result.HP.toFixed(0) }}</el-text>
              <el-text style="color: #333333">核心属性 : {{ result.coreAttribute.toFixed(0) }}</el-text>
              <el-text style="color: #333333">物理攻击 : {{ (result.coreAttribute / 5).toFixed(0) }}</el-text>
              <el-text style="color: #333333">魔法攻击 : {{ (result.coreAttribute / 5).toFixed(0) }}</el-text>
            </el-row>
            <el-row style="flex: 1;display: grid;margin-left: 20rpx;">
              <el-row>
                <el-text style="color: #333333;width: 130rpx">
                  会心 : {{ result.criticalStrike }}
                </el-text>
                <el-text>（{{ (result.criticalStrike / 39 + currentSkillTreeCriticalStrike).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="color: #333333;width: 130rpx">
                  调息 : {{ result.recovery }}
                </el-text>
                <el-text>（{{ (result.recovery / 39 + currentSkillTreeCD).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="color: #333333;width: 130rpx">
                  专精 : {{ result.expertise }}
                </el-text>
                <el-text>（{{ (result.expertise / 39 + currentSkillTreePureEssence).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="color: #333333;width: 130rpx">
                  破甲 : {{ result.armorPenetration }}
                </el-text>
                <el-text>（{{ (result.armorPenetration / 39).toFixed(2) }}%）</el-text>
              </el-row>
              <el-row>
                <el-text style="color: #333333;width: 130rpx">命中 : {{ result.accuracy }}</el-text>
                <el-text>（{{ (result.accuracy / 39 + 100).toFixed(2) }}%）</el-text>
              </el-row>
            </el-row>
            <el-row style="display: grid">
              <el-text style="color: #333333">物理防御 : {{ result.physicalDefense }}</el-text>
              <el-text style="color: #333333">魔法防御 : {{ result.magicDefense }}</el-text>
            </el-row>
          </el-row>
          <el-row style="margin-top: 5rpx;display: flex;flex-direction: column">
            <el-row style="border: 2rpx solid #999999;border-radius: 5rpx;padding: 10rpx;">
              <el-row style="display: grid" v-show="suitOther>=1">
                <el-text>其他套装</el-text>
                <el-text :style="{color: suitOther >= 2 ? 'chocolate' : '#aaaaaa'}">
                  2：会心、专精、调息和破甲属性中最高和最低值每相差100点，造成的伤害和治疗增加0.1%
                </el-text>
              </el-row>
              <el-row style="display: grid" v-show="suitNumber315>=2">
                <el-text>305套装</el-text>
                <el-text :style="{color: suitNumber315 >= 2 ? 'chocolate' : '#aaaaaa'}">
                  2：核心属性增加180点
                </el-text>
                <el-text :style="{color: suitNumber315 >= 4 ? 'chocolate' : '#aaaaaa'}">
                  4：最高的额外属性（会心、专精、调息、破甲）增加195点
                </el-text>
              </el-row>
              <el-row style="display: grid;margin-top: 10rpx">
                <el-row>
                  <el-text style="margin-right: 10rpx">325套装</el-text>
                  <el-text style="text-align: center;border: 1rpx dashed #666;border-radius: 3rpx;" v-show="suitSize1>=2">
                    {{ classSchool[0] }}
                  </el-text>
                  <el-text style="text-align: center;border: 1rpx dashed #666;border-radius: 3rpx;" v-show="suitSize2>=2">
                    {{ classSchool[1] }}
                  </el-text>
                </el-row>
                <el-row v-show="suitSize1<2 && suitSize2<2">无</el-row>
                <el-row style="display: flex;flex-flow: row" v-show="suitSize1>=2">
                  <el-row style="flex:1;display: grid;margin-left: 5rpx">
                    <el-text v-show="suitSize1>=2" :style="{color: suitSize1 >= 2 ? 'chocolate' : '#aaaaaa'}">
                      {{ suitAttribute1[0] }}
                    </el-text>
                    <el-text v-show="suitSize1>=2" :style="{color: suitSize1 >= 4 ? 'chocolate' : '#aaaaaa'}">
                      {{ suitAttribute1[1] }}
                    </el-text>
                  </el-row>
                </el-row>
                <el-row style="display: flex;flex-flow: row;margin-top: 5rpx" v-show="suitSize2>=2">
                  <el-row style="flex:1;display: grid;margin-left: 5rpx">
                    <el-text v-show="suitSize2>=2"
                             :style="{color: suitSize2 >= 2 ? 'chocolate' : '#aaaaaa'}">{{ suitAttribute2[0] }}
                    </el-text>
                    <el-text v-show="suitSize2>=2"
                             :style="{color: suitSize2 >= 4 ? 'chocolate' : '#aaaaaa'}">{{ suitAttribute2[1] }}
                    </el-text>
                  </el-row>
                </el-row>
              </el-row>
            </el-row>
            <el-row style="border: 2rpx solid #999999;border-radius: 5rpx;margin-top: 5rpx;padding: 10rpx;display: grid;">
              <el-text>特殊效果</el-text>
              <el-text v-for="item in specialAttributeList" :key="item.type" style="color: chocolate;line-height: 30rpx;">
                {{ item.type + "：" + item.content }}
              </el-text>
              <el-text v-show="specialAttributeList.length===0">无</el-text>
            </el-row>
          </el-row>
        </el-row>
      </el-watermark>
    </el-row>

  </el-dialog>
  <!--  <el-dialog :model-value="equipmentImage?.length>0" width="800" align-center>-->
  <!--    <el-image :src="equipmentImage"/>-->

  <!--  </el-dialog>-->
</template>

<script>
import {
  ElMessage
} from 'element-plus'
import html2canvas from "html2canvas";
import { base64ToPath } from "image-tools";

export default {
  data() {
    return {
      scrollHeight: localStorage.getItem("contentHeightRpx") - 120,
      user: JSON.parse(localStorage.getItem("user")) || {
        id: 0,
        username: '',
        phone: null,
        email: null,
        permissionLevel: 1
      },
      //基础属性
      basics: {
        coreAttribute: 1596,
        criticalStrike: 252,
        constitution: 639,
        physicalDefense: 878,
        magicDefense: 878,
      },
      //法宝核心
      aMagicWeapon: {
        coreAttribute: 893,
        HP: 3565
      },
      // 门派列表
      className: [{
        value: '青云'
      }, {
        value: '焚香'
      }, {
        value: '鬼王'
      }, {
        value: '合欢'
      }, {
        value: '灵汐'
      }],
      currentClassSchool: "",
      classSchool: ["雷青云", "剑青云"],

      //当前境界
      currentRealm: {
        constitution: 346.6,
        coreAttribute: 868.36,
        cultivationLevel: "筑基二",
        id: 3,
        spiritualRootLimit: 6970,
      },
      //境界列表
      realmList: [],
      equipmentLevel: '',

      // 定义部位映射对象
      equipmentSlotMapping: {
        "武器": "Weapon",
        "头部": "Head",
        "上身": "UpperBody",
        "手部": "Hand",
        "腰部": "Waist",
        "脚部": "Foot",
        "护符": "Charm",
        "法印": "Seal",
        "令牌": "Token"
      },
      //当前选择的职业
      currentClassName: localStorage.getItem("currentClassName") || "青云",
      allEquipment: [],
      classEquipment: {
        "Weapon": [],
        "Head": [],
        "UpperBody": [],
        "Hand": [],
        "Waist": [],
        "Foot": [],
        "Charm1": [],
        "Charm2": [],
        "Seal": [],
        "Token": []
      },
      // 当前选择的装备列表
      currentEquipment: [],
      hufu1: {
        id: 0,
        equipmentName: "",
        partType: 0,
        equipageClass: 0,
        coreAttribute: 0,
        constitution: 0,
        physicalDefense: 0,
        magicDefense: 0,
        criticalStrike: 0,
        recovery: 0,
        expertise: 0,
        armorPenetration: 0,
        accuracy: 0,
        equipmentSource: "无",
        qualityLevel: 0,
        isLoongSpiritEnhanced: false
      },
      hufu2: {
        id: 0,
        equipmentName: "",
        partType: 0,
        equipageClass: 0,
        coreAttribute: 0,
        constitution: 0,
        physicalDefense: 0,
        magicDefense: 0,
        criticalStrike: 0,
        recovery: 0,
        expertise: 0,
        armorPenetration: 0,
        accuracy: 0,
        equipmentSource: "无",
        qualityLevel: 0,
        isLoongSpiritEnhanced: false
      },
      // 当前选择装备
      totalAttribute: {
        "constitution": 0,
        "coreAttribute": 0,
        "physicalDefense": 0,
        "magicDefense": 0,
        "criticalStrike": 0,
        "recovery": 0,
        "expertise": 0,
        "armorPenetration": 0,
        "accuracy": 0,
      },
      currentSuitLevel: {},
      suitLevel: [{
        name: "否",
        level: 0
      }, {
        name: "桑约·玄",
        level: 315
      }, {
        name: "桑约·极",
        level: 325
      }],
      //其他套装数量
      suitOther: 0,
      //315套装数量
      suitNumber315: 0,
      suitSize1: 0,
      suitSize2: 0,
      //不同门派的套装效果
      suitAttribute1: [],
      suitAttribute2: [],

      //特殊效果列表
      specialAttributeList: [],

      //-----页面显示选中的灌注------
      //头部灌注
      currentHeadInlay: {},
      //手部灌注
      currentHandInlay: {},
      //腰部灌注
      currentWaistInlay: {},
      //上衣灌注
      currentUpperBodyInlay: {},
      //--------------------------
      //头盔灌注
      headInlay: [],
      //护腕灌注
      handInlay: [],
      //腰带灌注
      waistInlay: [],
      //上衣灌注
      upperBodyInlay: [],

      //灌注总属性
      inlayTotal: {
        //核心
        "coreAttribute": 0,
        //会心
        "criticalStrike": 0,
        //调息
        "recovery": 0,
        //专精
        "expertise": 0,
        //破甲
        "armorPenetration": 0,
        //命中
        "accuracy": 0,
        //生命
        "HP": 0
      },

      //---龙魂符相关---
      //龙魂符强化
      loongSpiritEnhanced: {
        "6": 0,
        "7": 0,
        "8": 0,
        "9": 0
      },
      loongSpiritEnhancedLevel: [],
      //龙魂符强化的额外属性
      loongSpiritEnhancedAttribute: {
        "6": {},
        "7": {},
        "8": {},
        "9": {}
      },
      //龙魂符强化的额外总属性，装等不影响提升不会影响防御属性
      loongSpiritEnhancedTotalAttribute: {
        coreAttribute: 0,
        constitution: 0,
        criticalStrike: 0,
        recovery: 0,
        expertise: 0,
        armorPenetration: 0,
        accuracy: 0,
      },
      //--------------

      //---天书-会心---
      currentSkillTreeCriticalStrike: 0,
      skillTreeCriticalStrike: [0, 4, 8],
      //---天书-调息---
      currentSkillTreeCD: 0,
      skillTreeCD: [0, 2, 4, 8],
      //---天书-专精---
      currentSkillTreePureEssence: 0,
      skillTreePureEssence: [0],
      //---天书-防御---
      currentSkillTreeDefense: 0,
      skillTreeDefense: [0, 15, 30],
      //---天书-气血---
      currentSkillTreeHP: 0,
      skillTreeHP: [0, 10, 20],
      //是否显示会心
      isShowCriticalStrike: true,
      //是否显示调息
      isShowCD: true,
      //是否显示专精
      isShowPureEssence: false,
      //是否显示防御
      isShowDefense: false,
      //是否显示气血
      isShowHP: false,
      //选中的法宝
      currentAMagicWeapon: {
        id: 0,
        name: "无",
        criticalStrike: 0,
        recovery: 0,
        expertise: 0,
        armorPenetration: 0,
        accuracy: 0
      },
      aMagicWeaponList: [],
      //法宝的核心属性加成
      aMagicWeaponCoreAttribute: 0,
      currentXingPo: [{
        "level": 315,
        "attribute": 42,
        "coreAttribute": 193,
        "HP": 753
      },
        {
          "level": 315,
          "attribute": 42,
          "coreAttribute": 193,
          "HP": 753
        },
        {
          "level": 315,
          "attribute": 42,
          "coreAttribute": 193,
          "HP": 753
        },
        {
          "level": 315,
          "attribute": 42,
          "coreAttribute": 193,
          "HP": 753
        }
      ],
      xingPoLevel: [{
        "level": 295,
        "attribute": 35,
        "coreAttribute": 159,
        "HP": 628
      },
        {
          "level": 315,
          "attribute": 42,
          "coreAttribute": 193,
          "HP": 753
        },
        {
          "level": 335,
          "attribute": 51,
          "coreAttribute": 230,
          "HP": 900
        },
      ],
      //星魄的总属性
      xingPoTotalAttribute: {
        //核心
        "coreAttribute": 0,
        //会心
        "criticalStrike": 0,
        //调息
        "recovery": 0,
        //专精
        "expertise": 0,
        //破甲
        "armorPenetration": 0,
        //生命
        "HP": 0
      },
      result: {
        //物理防御
        "physicalDefense": 0,
        //法术防御
        "magicDefense": 0,
        //核心
        "coreAttribute": 0,
        //会心
        "criticalStrike": 0,
        //调息
        "recovery": 0,
        //专精
        "expertise": 0,
        //破甲
        "armorPenetration": 0,
        //命中
        "accuracy": 0,
        //体
        "constitution": 0,
        //生命
        "HP": 0
      },
      hotConfigurationList: [],
      //是否分享配装至热门推荐
      isShareHot: false,
      //保存配装对话框
      submitEquipmentDialog: false,
      submitEquipmentFrom: {
        //配装器名字
        name: '',
        //职业专精
        school: '',
        //装备列表
        equipmentList: []
      },
      isShowSaveImageDialog: false,
      equipmentImage: "",
      imagePath: "url('../../public/bgimage/bg-qy.jpg')"
    }

  },
  methods: {
    loginEvent(data) {
      this.user = data
      this.getHotConfigurationName(this.currentClassName)
    },
    //获取灌注列表
    getInlay() {
      this.http.get('/inlay/all').then((response) => {
        if (response.data.code === 200) {
          for (let i in response.data.data) {
            switch (response.data.data[i].partType) {
              case 1: //上身
                this.upperBodyInlay.push(response.data.data[i]);
                break;
              case 2: //头部
                this.headInlay.push(response.data.data[i]);
                break;
              case 3: //手部
                this.handInlay.push(response.data.data[i]);
                break;
              case 4: //腰部
                this.waistInlay.push(response.data.data[i]);
                break;
              default:
                break;
            }
          }
        } else {
          ElMessage.error(response.data.message);
        }
      }).catch((error) => {
        ElMessage.error(error.message);
      })
    },
    //根据职业获取对应的装备
    getFetchData(profession) {
      this.http.get('/equipment/filter/' + profession /* + "/" + school*/).then(response => {
        if (response.data.code === 200) {
          this.allEquipment = response.data.data;
          let equipment = [...this.allEquipment]
          this.classEquipment = this.settleEquipment(equipment)
          this.applyAttribute()
        } else {
          ElMessage.error(response.data.message);
        }
      }).catch(error => {
        ElMessage.error('请求出错:', error);
      });
    },
    //获取境界
    getRealmLevel() {
      this.http.get('/cultivation/all')
          .then((response) => {
            if (response.data.code === 200) {
              this.realmList = response.data.data
              if (response.data.data.length > 0) {
                this.currentRealm = response.data.data[response.data.data.length - 1]
              }
            } else {
              ElMessage.error(response.data.message);
            }
          }).catch(error => {
        ElMessage.error(error.message);
      })
    },
    //获取法宝列表
    getAMagicWeapon() {
      this.http.get('/talisman/all').then(response => {
        if (response.data.code === 200) {
          this.aMagicWeaponList = [{
            id: 0,
            name: "无",
            criticalStrike: 0,
            recovery: 0,
            expertise: 0,
            armorPenetration: 0,
            accuracy: 0
          }]
          this.aMagicWeaponList = [...this.aMagicWeaponList, ...response.data.data];
          console.log(this.aMagicWeaponList)
        } else {
          ElMessage.error(response.data.message);
        }
      }).catch(error => {
        ElMessage.error(error.message);
      })
    },

    //根据热门推荐配装的Id获取推荐配装
    getHotConfigurationId(id) {
      this.http.get('/equipment/builds/' + id).then(response => {
        if (response.data.code === 200) {
          //应用装备

          this.currentClassName = response.data.data.buildClass
          this.currentClassSchool = response.data.data.buildSchool
          this.selectProfessionChange(this.currentClassName)
          this.currentEquipment = response.data.data.equipments
          response.data.data.equipments.forEach((any, index) => {
            if (any.partType === 6) {
              if (index === 6) {
                this.hufu1 = any
              } else if (index === 7) {
                this.hufu2 = any
              }
            }
            if (any.equipmentSource.includes('桑约·玄套装')) {
              this.currentSuitLevel[any.partType] = this.suitLevel[1]
            } else if (any.equipmentSource.includes('桑约·极套装')) {
              this.suitLevel.forEach((item, index) => {
                if (item.type === any.classSpecialize) {
                  this.currentSuitLevel[any.partType] = this.suitLevel[index]
                }
              })
            } else {
              this.currentSuitLevel[any.partType] = this.suitLevel[0]
            }
            this.loongSpiritEnhanced[index] = any.loongSpiritUpgradeCount * 5
            this.loongSpiritEnhancedSelectChange(index)
          })
          this.calculateSuit()
          this.currentAMagicWeapon = response.data.data.talisman
          this.currentSkillTreeCriticalStrike = response.data.data.skillTree.criticalStrike
          this.currentSkillTreePureEssence = response.data.data.skillTree.expertise
          this.currentSkillTreeDefense = response.data.data.skillTree.defense
          this.currentSkillTreeCD = response.data.data.skillTree.recovery
          this.currentSkillTreeHP = response.data.data.skillTree.hp

          //应用灌注
          let upperBodyInlay = []
          let headInlay = []
          let handInlay = []
          let waistInlay = []
          response.data.data.inlays.forEach((inlay) => {
            switch (inlay.partType) {
              case 1: //上身
                upperBodyInlay.push(inlay)
                break
              case 2: //头部
                headInlay.push(inlay)
                break
              case 3: //手部
                handInlay.push(inlay)
                break
              case 4: //腰部
                waistInlay.push(inlay)
                break
            }
          })
          this.currentUpperBodyInlay = {}
          this.currentHeadInlay = {}
          this.currentHandInlay = {}
          this.currentWaistInlay = {}
          upperBodyInlay.forEach((inlay, index) => {
            this.currentUpperBodyInlay[index + 1] = inlay
          })
          headInlay.forEach((inlay, index) => {
            this.currentHeadInlay[index + 1] = inlay
          })
          handInlay.forEach((inlay, index) => {
            this.currentHandInlay[index + 1] = inlay
          })
          waistInlay.forEach((inlay, index) => {
            this.currentWaistInlay[index + 1] = inlay
          })
          this.calculateEquipment()
          this.inlaySelectChange()
          // this.applyAttribute()
        } else {
          ElMessage.error(response.data.message);
        }
      })
    },
    //根据职业获取对应的热门配装列表
    getHotConfigurationName(classname) {
      this.http.get('/equipment/builds/recommend/' + classname).then(response => {
        if (response.data.code === 200) {
          this.hotConfigurationList = response.data.data
        } else {
          ElMessage.error(response.data.message);
        }
      }).catch(error => {
        ElMessage.error(error.message)
      })
    },
    //点赞推荐配装
    // likeHotConfiguration(id) {
    //     this.http.get('/equipment/builds/like/' + id).then(_ => {
    //         // this.currentEquipment[0]
    //     })
    // },
    //一些默认属性设置
    setPageData() {
      // 当前属性值
      this.currentEquipment = []
      this.result = { //物理防御
        "physicalDefense": 0,
        //法术防御
        "magicDefense": 0,
        //核心
        "coreAttribute": 0,
        //会心
        "criticalStrike": 0,
        //调息
        "recovery": 0,
        //专精
        "expertise": 0,
        //破甲
        "armorPenetration": 0,
        //命中
        "accuracy": 0,
        //体
        "constitution": 0,
        //生命
        "HP": 0
      }
      for (let i = 0; i < 10; i++) {
        this.currentEquipment.push({
          id: 0,
          equipmentName: "",
          partType: 0,
          equipageClass: 0,
          coreAttribute: 0,
          constitution: 0,
          physicalDefense: 0,
          magicDefense: 0,
          criticalStrike: 0,
          recovery: 0,
          expertise: 0,
          armorPenetration: 0,
          accuracy: 0,
          equipmentSource: "无",
          specialAttribute: "",
          qualityLevel: 0,
          isLoongSpiritEnhanced: false
        })
      }
      for (let i in this.loongSpiritEnhancedAttribute) {
        this.loongSpiritEnhancedAttribute[i] = {
          coreAttribute: 0,
          constitution: 0,
          physicalDefense: 0,
          magicDefense: 0,
          criticalStrike: 0,
          recovery: 0,
          expertise: 0,
          armorPenetration: 0,
          accuracy: 0,
        }
      }
      this.xingPoSelectChange()
    },

    //选择境界监听
    selectRealmChange(any) {
      this.applyAttribute()
    },
    //选择职业监听
    selectProfessionChange(any) {
      this.currentSuitLevel = {}
      this.currentSkillTreeCriticalStrike = 0
      this.currentSkillTreePureEssence = 0
      this.currentSkillTreeDefense = 0
      this.currentSkillTreeCD = 0
      this.currentSkillTreeHP = 0
      this.isShowDefense = false;
      this.isShowHP = false
      this.isShowCriticalStrike = false;
      this.isShowCD = false;
      this.isShowPureEssence = false;
      localStorage.setItem("currentClassName", any)
      this.getHotConfigurationName(any)
      this.currentEquipment = []
      this.setPageData()
      let a = ""
      let b = ""
      switch (any) {
        case "青云":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 4, 8]
          this.classSchool = ["雷青云", "剑青云"]
          this.currentClassSchool = "剑青云"
          a = "雷"
          b = "剑"
          this.imagePath = "url('/bgimage/bg-qy.jpg')"
          break;
        case "焚香":
          this.isShowCriticalStrike = true;
          this.skillTreeCriticalStrike = [0, 4]
          this.isShowCD = true;
          this.skillTreeCD = [0, 4]
          this.classSchool = ["炎焚香", "咒焚香"]
          this.currentClassSchool = "炎焚香"
          a = "炎"
          b = "咒"
          this.imagePath = "url('/bgimage/bg-fx.jpg')"
          break;
        case "鬼王":
          this.isShowDefense = true
          this.isShowHP = true
          this.skillTreeDefense = [0, 15, 30]
          this.skillTreeHP = [0, 10, 20]
          this.classSchool = ["罡鬼王", "煞鬼王"]
          this.currentClassSchool = "罡鬼王"
          a = "罡"
          b = "煞"
          this.imagePath = "url('/bgimage/bg-gw.jpg')"
          break;
        case "合欢":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 4, 8]
          this.skillTreePureEssence = [0, 4]
          this.classSchool = ["影合欢", "月合欢"]
          this.currentClassSchool = "影合欢"
          a = "影"
          b = "月"
          this.imagePath = "url('/bgimage/bg-hh.jpg')"
          break;
        case "灵汐":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 2]
          this.skillTreePureEssence = [0, 2]
          this.classSchool = ["灵灵汐", "汐灵汐"]
          this.currentClassSchool = "汐灵汐"
          a = "灵"
          b = "汐"
          this.imagePath = "url('/bgimage/bg-lx.jpg')"
          break;
        default:
          break;
      }
      this.suitLevel = [{
        name: "否",
        level: 0
      }, {
        name: "桑约·玄",
        level: 315
      }, {
        name: "桑约·极-" + a,
        type: this.classSchool[0],
        level: 325
      }, {
        name: "桑约·极-" + b,
        type: this.classSchool[1],
        level: 325
      }]
      this.getFetchData(any)
    },
    //选择职业专精监听
    selectSchoolChange(any) {
      this.currentSkillTreeCriticalStrike = 0
      this.currentSkillTreePureEssence = 0
      this.currentSkillTreeDefense = 0
      this.currentSkillTreeCD = 0
      this.currentSkillTreeHP = 0
      this.isShowDefense = false;
      this.isShowCriticalStrike = false;
      this.isShowCD = false;
      this.isShowPureEssence = false;
      this.isShowHP = false
      switch (any) {
        case "雷青云":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 2]
          this.skillTreeCD = [0, 2]
          this.skillTreePureEssence = [0, 2]
          break;
        case "剑青云":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 4, 8]
          break;
        case "炎焚香":
          this.isShowCriticalStrike = true;
          this.skillTreeCriticalStrike = [0, 4]
          this.isShowCD = true;
          this.skillTreeCD = [0, 4]
          break;
        case "咒焚香":
          this.isShowCriticalStrike = true;
          this.skillTreeCriticalStrike = [0, 4]
          this.isShowCD = true;
          this.skillTreeCD = [0, 4]
          break;
        case "罡鬼王":
          this.isShowHP = true
          this.isShowDefense = true
          this.skillTreeDefense = [0, 15, 30]
          this.skillTreeHP = [0, 10, 20]
          break;
        case "煞鬼王":
          this.isShowCriticalStrike = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 2.5, 5]
          this.skillTreePureEssence = [0, 3, 6]
          break;
        case "影合欢":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 4, 8]
          this.skillTreePureEssence = [0, 4]
          break;
        case "月合欢":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 4, 8]
          this.skillTreePureEssence = [0, 4]
          break;
        case "灵灵汐":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 2]
          this.skillTreePureEssence = [0, 2]
          break;
        case "汐灵汐":
          this.isShowCriticalStrike = true;
          this.isShowCD = true;
          this.isShowPureEssence = true;
          this.skillTreeCriticalStrike = [0, 4, 8]
          this.skillTreeCD = [0, 2]
          this.skillTreePureEssence = [0, 2]
          break;
        default:
          break;
      }
    },
    //根据等级搜索装备
    equipmentLevelChange(level) {
      if (level.length === 0) {
        let equipment = [...this.allEquipment]
        this.classEquipment = this.settleEquipment(equipment)
        return
      }
      let equipment = this.allEquipment.filter(item => item.qualityLevel.toString() === level)
      this.classEquipment = this.settleEquipment(equipment)
    },
    //整理装备数据
    settleEquipment(list) {
      let zhuangbei = {
        "Weapon": [],
        "Head": [],
        "UpperBody": [],
        "Hand": [],
        "Waist": [],
        "Foot": [],
        "Charm1": [],
        "Charm2": [],
        "Seal": [],
        "Token": []
      }
      for (const d of list) {
        let equipmentSlot = this.equipmentSlotMapping[d['equipmentSlot']]
        if (equipmentSlot === "Charm") {
          let hf1 = {
            ...d
          }
          let hf2 = {
            ...d
          }
          hf1.equipmentSlot = "护符1"
          zhuangbei["Charm1"].push(hf1)
          hf2.equipmentSlot = "护符2"
          zhuangbei["Charm2"].push(hf2)
        } else {
          zhuangbei[equipmentSlot].push(d)
        }
      }
      return zhuangbei
    },
    //选择装备监听
    equipmentSelectChange(any) {
      if (any.partType === 6) { //先选第二个护符，后选第一个护符
        if (this.currentEquipment[7].id > 0) { //第二个护符已经选了
          if (this.currentEquipment[7].id === any.id) { //第一个护符和第二个选择护符一样，把第二个护符调换至第一个
            [this.hufu1, this.currentEquipment[7]] = [this.currentEquipment[7], this.hufu1];
            this.hufu2 = {
              id: 0,
              equipmentName: "",
              partType: 0,
              equipageClass: 0,
              coreAttribute: 0,
              constitution: 0,
              physicalDefense: 0,
              magicDefense: 0,
              criticalStrike: 0,
              recovery: 0,
              expertise: 0,
              armorPenetration: 0,
              accuracy: 0,
              equipmentSource: "无",
              qualityLevel: 0,
              isLoongSpiritEnhanced: false
            }
          }
        }
      }
      if (any.equipmentSource.includes('桑约·玄套装')) {
        this.currentSuitLevel[any.partType] = this.suitLevel[1]
      } else if (any.equipmentSource.includes('桑约·极套装')) {
        this.suitLevel.forEach((item, index) => {
          if (item.type === any.classSpecialize) {
            this.currentSuitLevel[any.partType] = this.suitLevel[index]
          }
        })
      } else {
        this.currentSuitLevel[any.partType] = this.suitLevel[0]
      }

      this.calculateSuit()

      this.hufu1 = any
      this.loongSpiritEnhanced[any.partType] = 0
      this.loongSpiritEnhancedSelectChange(any.partType)
      this.calculateEquipment()
      this.inlaySelectChange()
    },
    //选择装备-第二个护符
    equipmentSelectChange1(any) {
      if (any.partType === 6) { //先选第一个护符，后选第二个护符
        if (this.currentEquipment[6].id > 0) { //第一个护符已经选了
          if (this.currentEquipment[6].id === any.id) { //第二个护符和第一个护符一样，把第一个护符调换至第二个
            [this.currentEquipment[6], this.hufu2] = [this.hufu2, this.currentEquipment[6]];
            this.hufu1 = {
              id: 0,
              equipmentName: "",
              partType: 0,
              equipageClass: 0,
              coreAttribute: 0,
              constitution: 0,
              physicalDefense: 0,
              magicDefense: 0,
              criticalStrike: 0,
              recovery: 0,
              expertise: 0,
              armorPenetration: 0,
              accuracy: 0,
              equipmentSource: "无",
              qualityLevel: 0,
              isLoongSpiritEnhanced: false
            }
          }
        }
      }
      this.hufu2 = any
      //每次选择装备，让龙魂符强化为0
      this.loongSpiritEnhanced[7] = 0
      this.loongSpiritEnhancedSelectChange(7)
      this.calculateEquipment()
      this.applyAttribute()
    },
    //选择灌注
    inlaySelectChange() {
      var inlayList = []
      for (var i in this.currentHeadInlay) {
        let a = this.currentHeadInlay[i]
        //如果头盔是世界boss的，则增加灌注属性，这里不用id来判断的原因是因为，每个职业都有一个世界boss的装备，判断起来太麻烦，所以干脆用名称判断
        if (this.currentEquipment[2].equipmentName.includes('倏忽无同')) {
          a.coreAttribute = (this.currentHeadInlay[i].coreAttribute * 1.2).toFixed(0)
        } else {
          a = this.currentHeadInlay[i]
        }
        inlayList.push(a)
      }
      for (var j in this.currentHandInlay) {
        let a = {
          ...this.currentHandInlay[j]
        }
        //如果护腕是世界boss的，则增加灌注属性，这里不用id来判断的原因是因为，每个职业都有一个世界boss的装备，判断起来太麻烦，所以干脆用名称判断
        if (this.currentEquipment[3].equipmentName.includes('倏忽无同')) {
          a.criticalStrike = this.currentHandInlay[j].criticalStrike * 1.5
          a.expertise = this.currentHandInlay[j].expertise * 1.5
          a.armorPenetration = this.currentHandInlay[j].armorPenetration * 1.5
          a.recovery = this.currentHandInlay[j].recovery * 1.5
          a.accuracy = this.currentHandInlay[j].accuracy * 1.5
        } else {
          a = this.currentHandInlay[j]
        }
        inlayList.push(a)
      }
      for (var k in this.currentWaistInlay) { //处理腰带灌注
        let a = {
          ...this.currentWaistInlay[k]
        }
        //如果腰带是世界boss的，则增加灌注属性，这里不用id来判断的原因是因为，每个职业都有一个世界boss的装备，判断起来太麻烦，所以干脆用名称判断
        if (this.currentEquipment[4].equipmentName.includes('倏忽无同')) {
          a.criticalStrike = this.currentWaistInlay[k].criticalStrike * 1.5
          a.expertise = this.currentWaistInlay[k].expertise * 1.5
          a.armorPenetration = this.currentWaistInlay[k].armorPenetration * 1.5
          a.recovery = this.currentWaistInlay[k].recovery * 1.5
          a.accuracy = this.currentWaistInlay[k].accuracy * 1.5
        } else {
          a = this.currentWaistInlay[k]
        }
        inlayList.push(a)
      }
      for (var l in this.currentUpperBodyInlay) {
        let a = {
          ...this.currentUpperBodyInlay[l]
        }
        //如果腰带是世界boss的，则增加灌注属性，这里不用id来判断的原因是因为，每个职业都有一个世界boss的装备，判断起来太麻烦，所以干脆用名称判断
        if (this.currentEquipment[1].equipmentName.includes('倏忽无同')) {
          a.blood = (a.blood * 1.35).toFixed(0)
        } else {
          a = this.currentUpperBodyInlay[l]
        }
        inlayList.push(a)
      }
      let coreAttribute = 0;
      let criticalStrike = 0
      let expertise = 0
      let armorPenetration = 0
      let recovery = 0
      let accuracy = 0
      let hp = 0
      inlayList.forEach(inlay => {
        coreAttribute += inlay.coreAttribute
        criticalStrike += inlay.criticalStrike
        expertise += inlay.expertise
        armorPenetration += inlay.armorPenetration
        recovery += inlay.recovery
        accuracy += inlay.accuracy
        hp += inlay.blood
      })
      this.inlayTotal.coreAttribute = coreAttribute
      this.inlayTotal.criticalStrike = criticalStrike
      this.inlayTotal.expertise = expertise
      this.inlayTotal.armorPenetration = armorPenetration
      this.inlayTotal.recovery = recovery
      this.inlayTotal.accuracy = accuracy
      this.inlayTotal.HP = hp
      this.applyAttribute()
    },
    //选择是否为套装
    isSuitChange(isSuit, type) {
      this.currentEquipment[type].classSpecialize = this.currentSuitLevel[type].type
      this.calculateSuit()
      this.applyAttribute()
    },
    //计算龙魂符强化等级列表
    loongSpiritEnhancedList(isOpen, type) {
      if (isOpen) {
        let level = []
        for (let i = 0; i <= this.currentEquipment[type].loongSpiritUpgradeCount; i++) {
          level.push(i * 5)
        }
        this.loongSpiritEnhancedLevel = level
      }
    },
    //计算每个部位龙魂符强化后的额外属性
    loongSpiritEnhancedSelectChange(type) {
      /*
      把当前选择龙魂符强化的部位的每个属性数值存放进集合对应的位置中
      如果数值为负数则不计算，只返回数值本身
       */
      this.loongSpiritEnhancedAttribute[type] = {
        "coreAttribute": (this.currentEquipment[type].coreAttribute * (1.05 ** (this.loongSpiritEnhanced[
            type] / 5))).toFixed(0) - this.currentEquipment[type].coreAttribute,
        "constitution": this.currentEquipment[type].constitution < 0 ? 0 : (this.currentEquipment[type]
            .constitution * (1.05 ** (this.loongSpiritEnhanced[type] / 5))).toFixed(0) - this
            .currentEquipment[type].constitution,
        "criticalStrike": this.currentEquipment[type].criticalStrike < 0 ? 0 : (this.currentEquipment[type]
            .criticalStrike * (1.05 ** (this.loongSpiritEnhanced[type] / 5))).toFixed(0) - this
            .currentEquipment[type].criticalStrike,
        "recovery": this.currentEquipment[type].recovery < 0 ? 0 : (this.currentEquipment[type].recovery *
            (1.05 ** (this.loongSpiritEnhanced[type] / 5))).toFixed(0) - this.currentEquipment[type]
            .recovery,
        "expertise": this.currentEquipment[type].expertise < 0 ? 0 : (this.currentEquipment[type]
            .expertise * (1.05 ** (this.loongSpiritEnhanced[type] / 5))).toFixed(0) - this
            .currentEquipment[type].expertise,
        "armorPenetration": this.currentEquipment[type].armorPenetration < 0 ? 0 : (this.currentEquipment[
            type].armorPenetration * (1.05 ** (this.loongSpiritEnhanced[type] / 5))).toFixed(0) - this
            .currentEquipment[type].armorPenetration,
        "accuracy": this.currentEquipment[type].accuracy < 0 ? 0 : (this.currentEquipment[type].accuracy *
            (1.05 ** (this.loongSpiritEnhanced[type] / 5))).toFixed(0) - this.currentEquipment[type]
            .accuracy,
      }
      let array = {
        ...this.loongSpiritEnhancedAttribute
      }

      let coreAttribute = 0
      let constitution = 0
      let criticalStrike = 0
      let recovery = 0
      let expertise = 0
      let armorPenetration = 0
      let accuracy = 0
      for (const i in array) {
        coreAttribute += array[i].coreAttribute
        constitution += array[i].constitution
        criticalStrike += array[i].criticalStrike
        recovery += array[i].recovery
        expertise += array[i].expertise
        armorPenetration += array[i].armorPenetration
        accuracy += array[i].accuracy
      }
      this.loongSpiritEnhancedTotalAttribute.coreAttribute = coreAttribute
      this.loongSpiritEnhancedTotalAttribute.constitution = constitution
      this.loongSpiritEnhancedTotalAttribute.criticalStrike = criticalStrike
      this.loongSpiritEnhancedTotalAttribute.recovery = recovery
      this.loongSpiritEnhancedTotalAttribute.expertise = expertise
      this.loongSpiritEnhancedTotalAttribute.armorPenetration = armorPenetration
      this.loongSpiritEnhancedTotalAttribute.accuracy = accuracy

      this.applyAttribute()
    },

    //选择法宝监听
    aMagicWeaponSelectChange() {
      this.applyAttribute()
    },
    //星魄选择监听
    xingPoSelectChange() {
      let totalCoreAttribute = 0
      let criticalStrike = 0
      let expertise = 0
      let armorPenetration = 0
      let recovery = 0
      let totalHP = 0;
      this.currentXingPo.forEach((item) => {
        totalCoreAttribute += item.coreAttribute
        totalHP += item.HP
      })
      criticalStrike = this.currentXingPo[0].attribute * 3
      recovery = this.currentXingPo[1].attribute * 3
      armorPenetration = this.currentXingPo[2].attribute * 3
      expertise = this.currentXingPo[3].attribute * 3
      this.xingPoTotalAttribute.coreAttribute = totalCoreAttribute
      this.xingPoTotalAttribute.criticalStrike = criticalStrike
      this.xingPoTotalAttribute.recovery = recovery
      this.xingPoTotalAttribute.armorPenetration = armorPenetration
      this.xingPoTotalAttribute.expertise = expertise
      this.xingPoTotalAttribute.HP = totalHP

      this.applyAttribute()
    },
    //计算套装
    calculateSuit() {
      let suitNumber315 = 0
      for (const [key, value] of Object.entries(this.currentSuitLevel)) {
        if (value.level === 315) {
          suitNumber315++
        }
      }
      this.suitNumber315 = suitNumber315

      this.suitSize1 = 0
      this.suitSize2 = 0
      switch (this.currentClassName) {
        case "青云":
          this.classSchool = ["雷青云", "剑青云"]
          this.suitSize1 = this.currentEquipment.filter(value => value.classSpecialize === "雷青云").length
          this.suitSize2 = this.currentEquipment.filter(value => value.classSpecialize === "剑青云").length
          if (this.suitSize1 >= 2) {
            this.suitAttribute1 = [
              "2：引雷诀、真霆雷动、神剑御雷真诀造成的伤害提高15%",
              "4：释放真霆雷动获得1层【纵溢】效果，释放神剑御雷真诀获得3层【纵溢】效果，消耗【纵溢】效果可无视消耗释放一次引雷诀，【雷元爆发】状态下，消耗【纵溢】效果的引雷诀造成伤害提高50%"
            ]
          }
          if (this.suitSize2 >= 2) {
            this.suitAttribute2 = [
              "2：道剑纵横、穿星造成的伤害提高20%；剑扫六合造成的伤害提高30%",
              "4：释放剑心通明和寰宇千锋时，分别获得1/2层【凌绝】效果，消耗【凌绝】效果可无视冷却释放一次道剑纵横，通过此效果获得的道剑纵横无法使自身获得无敌效果；道剑纵横使自身获得3秒剑心通明或6秒寰宇千锋效果（取决于自身所习得的秘技）",
            ]
          }
          console.log(this.suitSize1, this.suitSize2)
          break;
        case "焚香":
          this.classSchool = ["炎焚香", "咒焚香"]
          this.suitSize1 = this.currentEquipment.filter(value => value.classSpecialize === "炎焚香").length
          this.suitSize2 = this.currentEquipment.filter(value => value.classSpecialize === "咒焚香").length
          if (this.suitSize1 >= 2) {
            this.suitAttribute1 = [
              "2：炎龙降世或轰焱的会心率提升15%",
              "4：释放炎龙印刻后，6秒内自身会心率增加40%",
            ]
          }
          if (this.suitSize2 >= 2) {
            this.suitAttribute2 = [
              "2：玄阳天律会心率增加30%",
              "4：每使用一次灵引，玄阳天律冷却减少3秒"
            ]
          }
          break;
        case "鬼王":
          this.classSchool = ["罡鬼王", "煞鬼王"]
          this.suitSize1 = this.currentEquipment.filter(value => value.classSpecialize === "罡鬼王").length
          this.suitSize2 = this.currentEquipment.filter(value => value.classSpecialize === "煞鬼王").length
          if (this.suitSize1 >= 2) {
            this.suitAttribute1 = [
              "2：追魂斩造成的伤害提高20%，并恢复自身等同于物理攻击的气血",
              "4：聚灵斩充能层数增加1次，聚灵斩每消耗一层破绽，减少1秒明王降世咒冷却时间"
            ]
          }
          if (this.suitSize2 >= 2) {
            this.suitAttribute2 = [
              "2：鬼王每秒额外恢复30点魔性",
              "4：鬼斩、湮魂爪每次命中减少魔性大发、明王降世咒技能0.3秒冷却时间，魔性大发、明王降世咒期间对怪物造成伤害增加25%",
            ]
          }
          break;
        case "合欢":
          this.classSchool = ["影合欢", "月合欢"]
          this.suitSize1 = this.currentEquipment.filter(value => value.classSpecialize === "影合欢").length
          this.suitSize2 = this.currentEquipment.filter(value => value.classSpecialize === "月合欢").length
          if (this.suitSize1 >= 2) {
            this.suitAttribute1 = [
              "2：拂袖千星的月能消耗提高20点，拂袖千星、拂袖千星·影的伤害提高25%",
              "4：每次释放影舞，下次影舞、影舞·影伤害提高60%，并获得拂袖千星·暗香"
            ]
          }
          if (this.suitSize2 >= 2) {
            this.suitAttribute2 = [
              "2：月刃之息伤害提高15%",
              "4：月无情和月袭的会心率提高8%，并且每释放5次月刃之息获得一个不消耗冷却、不消耗月能的月无情和月袭",
            ]
          }
          break;
        case "灵汐":
          this.classSchool = ["灵灵汐", "汐灵汐"]
          this.suitSize1 = this.currentEquipment.filter(value => value.classSpecialize === "灵灵汐").length
          this.suitSize2 = this.currentEquipment.filter(value => value.classSpecialize === "汐灵汐").length
          if (this.suitSize1 >= 2) {
            this.suitAttribute1 = [
              "2：对敌人释放甘霖时恢复自身1枚鱼灵；甘霖每次造成伤害时，自身获得2层【怒潮】效果，灵爆会消耗所有【怒潮】效果，每层【怒潮】使敌人额外受到86水属性伤害，此伤害受到自身专精率影响",
              "4：碎雨和潮歌每次造成伤害时，为自身叠加1层【怒潮】效果；进入战斗时，立刻获得40层【怒潮】效果",
            ]
          }
          if (this.suitSize2 >= 2) {
            this.suitAttribute2 = [
              "2：甘霖为目标添加【飞鳐守护】效果，使其在下次受到伤害时恢复2532气血",
              "4：消耗【飞鳐守护】使目标受到自身的气血恢复效果提高10%，持续10秒。"
            ]
          }
          break;
        default:
          break;
      }
      //根据套装，判断当前职业专精
      if (this.suitSize1 > this.suitSize2) {
        this.currentClassSchool = this.classSchool[0]
      } else if (this.suitSize1 < this.suitSize2) {
        this.currentClassSchool = this.classSchool[1]
      } else {
        this.currentClassSchool = this.classSchool[0]
      }
      this.selectSchoolChange(this.currentClassSchool)
    },
    //计算装备选择完毕后的属性总和
    calculateEquipment() {
      let a = 0
      let b = 0
      let c = 0
      let d = 0
      let e = 0
      let f = 0
      let g = 0
      let h = 0
      let j = 0
      for (let i in this.currentEquipment) {
        a += this.currentEquipment[i].coreAttribute
        b += this.currentEquipment[i].constitution
        c += this.currentEquipment[i].physicalDefense
        d += this.currentEquipment[i].magicDefense
        e += this.currentEquipment[i].criticalStrike
        f += this.currentEquipment[i].recovery
        g += this.currentEquipment[i].expertise
        h += this.currentEquipment[i].armorPenetration
        j += this.currentEquipment[i].accuracy
      }
      this.totalAttribute.coreAttribute = a
      this.totalAttribute.constitution = b
      this.totalAttribute.physicalDefense = c
      this.totalAttribute.magicDefense = d
      this.totalAttribute.criticalStrike = e
      this.totalAttribute.recovery = f
      this.totalAttribute.expertise = g
      this.totalAttribute.armorPenetration = h
      this.totalAttribute.accuracy = j
    },
    //应用属性
    applyAttribute() {
      //判断护符是否佩戴了【稀世·度天地】
      let hufuDTD = {
        coreAttributeCoefficient: 1,
        criticalStrike: 0,
        recovery: 0,
        expertise: 0,
        armorPenetration: 0,
        HP: 1
      }
      if (this.currentEquipment[6] != null && this.currentEquipment[6] !== undefined && this.currentEquipment[6]
              .id === 239 ||
          this.currentEquipment[7] != null && this.currentEquipment[7] !== undefined && this.currentEquipment[7]
              .id === 239) {
        hufuDTD.coreAttributeCoefficient = 1.01
        hufuDTD.criticalStrike = 39
        hufuDTD.recovery = 39
        hufuDTD.expertise = 39
        hufuDTD.armorPenetration = 39
        hufuDTD.HP = 1.01
      }

      if (this.currentClassName === "鬼王" && this.currentClassSchool === "罡鬼王") { //计算鬼王天书防御
        this.result.physicalDefense = this.basics.physicalDefense + this.totalAttribute.physicalDefense
        this.result.magicDefense = this.basics.magicDefense + this.totalAttribute.magicDefense

        this.result.physicalDefense = this.result.physicalDefense * 1.5 + this.result.physicalDefense * (this
            .currentSkillTreeDefense / 100)
        this.result.magicDefense = this.result.magicDefense * 1.5 + this.result.magicDefense * (this
            .currentSkillTreeDefense / 100)
      } else {
        this.currentSkillTreeDefense = 0
        this.result.physicalDefense = this.basics.physicalDefense + this.totalAttribute.physicalDefense
        this.result.magicDefense = this.basics.magicDefense + this.totalAttribute.magicDefense
      }
      this.result.coreAttribute = (this.basics.coreAttribute + this.totalAttribute.coreAttribute +
              this.loongSpiritEnhancedTotalAttribute.coreAttribute + this.currentRealm.coreAttribute +
              this.inlayTotal.coreAttribute + this.aMagicWeapon.coreAttribute + this.xingPoTotalAttribute
                  .coreAttribute) *
          hufuDTD.coreAttributeCoefficient
      this.result.criticalStrike = this.basics.criticalStrike + this.totalAttribute.criticalStrike +
          this.loongSpiritEnhancedTotalAttribute.criticalStrike + this.inlayTotal.criticalStrike +
          this.xingPoTotalAttribute.criticalStrike + (this.currentAMagicWeapon?.criticalStrike || 0) +
          hufuDTD.criticalStrike
      this.result.recovery = this.totalAttribute.recovery + this.loongSpiritEnhancedTotalAttribute.recovery +
          this.inlayTotal.recovery + this.xingPoTotalAttribute.recovery + (this.currentAMagicWeapon?.recovery ||
              0) +
          hufuDTD.recovery
      this.result.expertise = this.totalAttribute.expertise + this.loongSpiritEnhancedTotalAttribute.expertise +
          this.inlayTotal.expertise + this.xingPoTotalAttribute.expertise + (this.currentAMagicWeapon
              ?.expertise || 0) +
          hufuDTD.expertise
      this.result.armorPenetration = this.totalAttribute.armorPenetration + this
              .loongSpiritEnhancedTotalAttribute.armorPenetration +
          this.inlayTotal.armorPenetration + this.xingPoTotalAttribute.armorPenetration + (this
              .currentAMagicWeapon?.armorPenetration || 0) + hufuDTD.armorPenetration
      this.result.accuracy = this.totalAttribute.accuracy + this.loongSpiritEnhancedTotalAttribute.accuracy +
          this.inlayTotal.accuracy + (this.currentAMagicWeapon?.accuracy || 0)
      this.result.constitution = this.basics.constitution + this.totalAttribute.constitution +
          this.loongSpiritEnhancedTotalAttribute.constitution + this.currentRealm.constitution
      this.result.HP = (this.result.constitution * 10 + this.aMagicWeapon.HP + this.inlayTotal.HP + this
          .xingPoTotalAttribute.HP) * hufuDTD.HP
      if (this.currentClassName === "鬼王" && this.currentClassSchool === "罡鬼王") {
        this.result.HP = this.result.HP + (this.result.HP * 0.3) + (this.result.HP * (this.currentSkillTreeHP /
            100))
      }
      let suitNumber315 = 0
      let specialAttribute = []
      this.currentEquipment.forEach((item) => {
        if (item != null) {
          //把特殊效果放入集合里
          if (item.specialAttribute?.length > 1) {
            specialAttribute.push({
              type: item.equipmentSlot,
              content: item.specialAttribute
            })
          }
        }
      })
      for (const [key, value] of Object.entries(this.currentSuitLevel)) {
        if (value.level === 315) {
          suitNumber315++
        }
      }

      this.specialAttributeList = specialAttribute
      this.suitNumber315 = suitNumber315
      //套装属性
      if (this.suitNumber315 >= 2) {
        this.result.coreAttribute += 180
      }
      if (this.suitNumber315 >= 4) {
        //计算套装属性分配给四维中的哪个
        let maxValue = Math.max(this.result.criticalStrike, this.result.recovery, this.result.expertise, this
            .result.armorPenetration)
        switch (maxValue) {
          case this.result.criticalStrike:
            this.result.criticalStrike += 195
            break;
          case this.result.recovery:
            this.result.recovery += 195
            break;
          case this.result.expertise:
            this.result.expertise += 195
            break;
          case this.result.armorPenetration:
            this.result.armorPenetration += 195
            break;
          default:
            break;
        }
      }

      //判断法印是否佩戴【太初玄元】
      if (this.currentEquipment[8] != null && this.currentEquipment[8] !== undefined && this.currentEquipment[8]
          .equipmentName.includes("太初玄元")) {
        if (this.result.accuracy > 585) {
          this.result.accuracy -= 78
        } else {
          this.result.accuracy += 78
        }
      }
      //判断令牌是否佩戴【稀世·渡彼岸】
      if (this.currentEquipment[9] != null && this.currentEquipment[9] !== undefined && this.currentEquipment[9]
          .equipmentName.includes("稀世·渡彼岸")) {
        //计算渡彼岸属性分配给哪个
        let maxValue = Math.max(this.result.criticalStrike, this.result.recovery, this.result.expertise, this
            .result.armorPenetration)
        switch (maxValue) {
          case this.result.criticalStrike:
            this.result.criticalStrike += 190
            break;
          case this.result.recovery:
            this.result.recovery += 190
            break;
          case this.result.expertise:
            this.result.expertise += 190
            break;
          case this.result.armorPenetration:
            this.result.armorPenetration += 190
            break;
          default:
            break;
        }
      } else if (this.currentEquipment[9] != null && this.currentEquipment[9] !== undefined && this
          .currentEquipment[9].equipmentName.includes("乾坤无极")) {
        //判断是否佩戴【乾坤无极】
        let minValue = Math.min(this.result.criticalStrike, this.result.recovery, this.result.expertise, this
            .result.armorPenetration)
        switch (minValue) {
          case this.result.criticalStrike:
            this.result.criticalStrike -= 78
            break;
          case this.result.recovery:
            this.result.recovery -= 78
            break;
          case this.result.expertise:
            this.result.expertise -= 78
            break;
          case this.result.armorPenetration:
            this.result.armorPenetration -= 78
            break;
          default:
            break;
        }
      }
      let suitO = 0
      if (this.currentEquipment[6]?.equipmentName.includes("幽海通玄") || this.currentEquipment[7]?.equipmentName
          .includes("幽海通玄")) {
        suitO++
      }
      if (this.currentEquipment[0]?.equipmentName.includes("九幽锋寒") || (this.currentEquipment[0]?.equipmentName
          .includes("神兵") && this.currentEquipment[0]?.qualityLevel === 335)) {
        suitO++
      }
      this.suitOther = suitO
    },
    //保存配装
    save() {
      if (this.user.id === 0) {
        this.$emitter.emit("login", true)
        // this.$emitter.off("login")
        return
      }
      let count = this.currentEquipment.filter(equipment => equipment.id > 0).length

      if (count === 10) {
        let zhuangbeiList = []
        this.currentEquipment.forEach((item, index) => {
          let inlayId = []
          switch (index) {
            case 1:
              let upperBody = []
              for (let i in this.currentUpperBodyInlay) {
                upperBody.push({
                  id: this.currentUpperBodyInlay[i].id
                })
              }
              inlayId = upperBody
              break;
            case 2:
              let head = []
              for (let i in this.currentHeadInlay) {
                head.push({
                  id: this.currentHeadInlay[i].id
                })
              }
              inlayId = head
              break
            case 3:
              let hand = []
              for (let i in this.currentHandInlay) {
                hand.push({
                  id: this.currentHandInlay[i].id
                })
              }
              inlayId = hand
              break
            case 4:
              let waist = []
              for (let i in this.currentWaistInlay) {
                waist.push({
                  id: this.currentWaistInlay[i].id
                })
              }
              inlayId = waist
              break;
            default:
              break;
          }
          zhuangbeiList.push({
            type: index,
            equipmentId: item.id,
            inlayId: inlayId
          })
        })
        this.submitEquipmentFrom.equipmentList = zhuangbeiList
        this.submitEquipmentDialog = true
      } else if (count > 10) {
        ElMessage.error("装备列表异常，请刷新页面重新搭配")
      } else {
        ElMessage.error("请完善配装内容")
      }
    },
    //配装内容保存成图片
    saveImage() {
      let count = this.currentEquipment.filter(equipment => equipment.id > 0).length
      if (count === 10) {
        this.isShowSaveImageDialog = true
      } else if (count > 10) {
        ElMessage.error("装备列表异常，请刷新页面重新搭配")
      } else {
        ElMessage.error("请完善配装内容")
      }

    },

    saveImage1() {
      this.equipmentImage = ""
      const element = document.getElementById("imageSave") // 获取DOM元素引用
      html2canvas(element).then(canvas => {
        const imgData = canvas.toDataURL("image/png"); // 获取Base64编码的图片数据URL
        // this.equipmentImage = imgData
        this.saveBase64AsFile(imgData, this.currentClassName + "-" + this.currentClassSchool +
            "-配装方案.png")
      });
    },

    //提交接口
    submitEquipmentBtn() {
      this.http.post('equipment/builds', {
        userId: this.user.id,
        buildClass: this.currentClassName,
        buildSchool: this.currentClassSchool,
        buildName: this.submitEquipmentFrom.name,
        equipmentBuilds: this.submitEquipmentFrom.equipmentList,
        amagicWeaponId: this.currentAMagicWeapon?.id || 0, //法宝
        skillTree: { //天书
          criticalStrike: this.currentSkillTreeCriticalStrike,
          recovery: this.currentSkillTreeCD,
          expertise: this.currentSkillTreePureEssence,
          defense: this.currentSkillTreeDefense,
          hp: this.currentSkillTreeHP
        }
      }).then(response => {
        if (response.data.code === 200) {
          ElMessage.success("提交成功")
          this.submitEquipmentDialog = false
          this.getHotConfigurationName(this.currentClassName)
        } else {
          ElMessage.error(response.data.message)
        }
      }).catch(error => {
        if (error.status === 403) {
          ElMessage.error("登录状态失效，请重新登录");
        } else {
          ElMessage.error(error.message)
        }
      })
    },
    submitEquipmentCancel() {
      this.submitEquipmentFrom.name = ""
      this.submitEquipmentFrom.school = ""
      this.submitEquipmentFrom.equipmentList = []
      this.submitEquipmentDialog = false
    },
    hotConfigurationListClick(id) {
      this.getHotConfigurationId(id)
    },
    //将Base64图片转换成文件
    saveBase64AsFile(base64Data, fileName) {
      // const link = document.createElement("a");
      // link.download = fileName
      // link.href = base64Data
      // link.click()
      // document.body.removeChild(link)
      // window.URL.revokeObjectURL(link)
      console.log(uni.getSystemInfoSync().uniPlatform)
      ElMessage.info(uni.getSystemInfoSync().uniPlatform)
      ElMessage.info(uni.getSystemInfoSync().hostName)
      switch (uni.getSystemInfoSync().uniPlatform) {
        case "web":
          // 1. 清理数据
          const cleanedBase64 = base64Data.replace(/^data:image\/\w+;base64,/, "").replace(/\s/g, "");
          try {
            base64ToPath(base64Data).then(path=>{
              console.log(path)
              const a = document.createElement('a');
              a.href = path;
              a.download = fileName;
              a.click();
              URL.revokeObjectURL(path);
            }).catch(error=>{
              console.log(error)
              ElMessage.error(error.message)
            })
          } catch (e) {
            ElMessage.error('下载失败:', e);
            // 安卓备用方案：直接使用 Base64
            const a = document.createElement('a');
            a.href = `data:image/png;base64,${cleanedBase64}`;
            a.download = fileName;
            a.click();
          }
          break
        case "mp-weixin":
          // 1. 处理字符串
          const processedBase64 = base64Data.replace(/^data:image\/\w+;base64,/, "").replace(/[\r\n]/g, "");
          // 2. 写入临时文件
          const fs = uni.getFileSystemManager();
          const filePath = `${wx.env.USER_DATA_PATH}/image_${Date.now()}.png`;
          fs.writeFile({
            filePath: filePath,
            data: processedBase64,
            encoding: 'base64',
            success: () => {
              // 3. 保存到相册
              uni.saveImageToPhotosAlbum({
                filePath: filePath,
                success: () => uni.showToast({title: '保存成功'}),
                fail: (err) => console.error('保存失败:', err)
              });
            },
            fail: (err) => console.error('写入失败:', err)
          });
          break
        case "mp-qq":
          break
      }
    },
  },
  mounted() {
    // this.$emitter.on('applyConfig', (config) => {
    //     this.$nextTick(() => {
    //         setTimeout(() => {
    //             switch (config.buildClass) {
    //                 case "青云":
    //                     this.imagePath = "url('/bgimage/bg-qy.jpg')"
    //                     break
    //                 case "焚香":
    //                     this.imagePath = "url('/bgimage/bg-fx.jpg')"
    //                     break
    //                 case "鬼王":
    //                     this.imagePath = "url('/bgimage/bg-gw.jpg')"
    //                     break
    //                 case "合欢":
    //                     this.imagePath = "url('/bgimage/bg-hh.jpg')"
    //                     break
    //                 case "灵汐":
    //                     this.imagePath = "url('/bgimage/bg-lx.jpg')"
    //                     break
    //             }
    //             this.getHotConfigurationId(config.id)
    //         }, 500)
    //     })
    // })
  },
  onReady() {
    this.isShowCriticalStrike = true;
    this.isShowCD = true;
    this.skillTreeCriticalStrike = [0, 2, 4, 8]
    this.skillTreeCD = [0, 2, 4, 8]
    this.setPageData()
    this.getInlay()
    this.selectProfessionChange(this.currentClassName)
    this.getRealmLevel()
    this.getAMagicWeapon()
    this.getHotConfigurationId(412)
  },
}
</script>
<style lang='scss' scoped>
/* 更改所有的下拉框样式 */
::v-deep .el-select-dropdown__item {
  font-size: 20rpx;
  padding-left: 20rpx;
  padding-right: 20rpx;
}
</style>